﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ShopList.aspx.vb" Inherits="WSCC_GlutenfreeKent.ShopList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <asp:Menu ID="Menu1" runat="server">
        <Items>
            <asp:MenuItem NavigateUrl="~/ShopPages/AddShop.aspx" Text="Add a Shop" 
                Value="Add a Shop"></asp:MenuItem>
        </Items>
    </asp:Menu>
        <br />
        <asp:Repeater ID="repeater_Tags" runat="server" DataSourceID="ShopTagsDS">
        <ItemTemplate>
        <a href="ShopList.aspx?Tag=<%# Eval("Tag")%>">
        <%#Eval("Tag")%> &nbsp
        </a>
        </ItemTemplate>
        </asp:Repeater>
        <asp:SqlDataSource ID="ShopTagsDS" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionStringRestaurants %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionStringRestaurants.ProviderName %>" 
            SelectCommand="SELECT [Tag] FROM [Tags]">
        </asp:SqlDataSource>
        </p>
<p>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="ShopDB" Height="104px" Width="918px">
        <Columns>
            <asp:ImageField DataImageUrlField="Photo" HeaderText="Photo">
                <ControlStyle Height="200px" Width="200px" />
            </asp:ImageField>
            <asp:HyperLinkField DataNavigateUrlFields="URL" 
                DataNavigateUrlFormatString="{0}" DataTextField="ShopName" 
                HeaderText="Shop Name" />
            <asp:TemplateField HeaderText="Rating">
            <ItemTemplate> <%# getRating(Eval("Rating"))%>
            </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="LastReviewDate" HeaderText="LastReviewDate" 
                SortExpression="LastReviewDate" DataFormatString="{0:d}" />
            <asp:HyperLinkField DataNavigateUrlFields="PostCode" 
                DataNavigateUrlFormatString="http://maps.google.co.uk/maps?q={0}" 
                DataTextField="PostCode" HeaderText="Location" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="/ShopPages/ShopDetails.aspx?ID={0}" HeaderText="Details" 
                Text="Detail" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="ShopDB" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionStringRestaurants %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionStringRestaurants.ProviderName %>" 
         CancelSelectOnNullParameter="false">
                     <SelectParameters>
                <asp:QueryStringParameter Name="Tag" QueryStringField="Tag" Type="String" />
            </SelectParameters>
    </asp:SqlDataSource>
</p>
</asp:Content>
